UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'JGKHYuraxxx4QiDeAvQep6mjEyOh9CcHC+2rHwJe9Oc='
WHERE
key_id = 'eed39b562c73b6a9ee7575f01113bc649d7f443593a3940256960716f89beedb'
AND (
token = 'JGKHYuraxxx4QiDeAvQep6mjEyOh9CcHC+2rHwJe9Oc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)