UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'j6XFjXRdUT1sFXO3maPKSswiKVQ+Qc2YzcVQkNYodn0='
WHERE
key_id = '905612f0ce9b320710f904ab73ce2daa9cc8629facfb964c37a8889d5c6c8c30'
AND (
token = 'j6XFjXRdUT1sFXO3maPKSswiKVQ+Qc2YzcVQkNYodn0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)