UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'UWVka/qeV9tKPdapxQITA7/VHQicv6Ge0IyB3gysqhg='
WHERE
key_id = '79096ea069eae3c31d91986657154d3298b54cace2d254afe11c83dbed494bbd'
AND (
token = 'UWVka/qeV9tKPdapxQITA7/VHQicv6Ge0IyB3gysqhg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)