UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'RvCIqNlAk3rVxMpb7c8/rh5XWcQpdlUN/lc8lDAeLXQ='
WHERE
key_id = '82f6d4383c6c1bfed07728c85ff751716369722f12f99751096036e2a994d5a4'
AND (
token = 'RvCIqNlAk3rVxMpb7c8/rh5XWcQpdlUN/lc8lDAeLXQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)