UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'kEu7AeR+rFNVXOgFgKnTta3+So42qhpbLwW7eTaRbCU='
WHERE
key_id = '58b8a5c722857805e03faf8ea9bb5075786199ad90914634566ce7ff00960fdb'
AND (
token = 'kEu7AeR+rFNVXOgFgKnTta3+So42qhpbLwW7eTaRbCU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)