UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7y7lRm1hPGsMfpoNdYnudU4LR9bGsKy7L6XW5NGh0sE='
WHERE
key_id = '97f7064e57c19711f7416d76dc121989776931184837e3208cc853df236a5a9b'
AND (
token = '7y7lRm1hPGsMfpoNdYnudU4LR9bGsKy7L6XW5NGh0sE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)