UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ra+IBl7trYKLwApnoJxQfZA6EOcxVKciEgmeHbAFTtE='
WHERE
key_id = '535f5983c32768848bae5944e8da874ebb36cdc7c52174485187315a82b1e6a0'
AND (
token = 'ra+IBl7trYKLwApnoJxQfZA6EOcxVKciEgmeHbAFTtE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)