UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'R0+mLE3/P6dAAAYZJsT3mIqFXE8k+WH/2Kh4G6eSRH0='
WHERE
key_id = 'df0d142901a5f10f6801c7e4639552346b9e12261eceb3cf7882844dc0f1333a'
AND (
token = 'R0+mLE3/P6dAAAYZJsT3mIqFXE8k+WH/2Kh4G6eSRH0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)