UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'fh1fVtvRA7bDb60LkizVvuxs7PKeM8KNJMWKu76nb0E='
WHERE
key_id = 'ade0a3fab8de6847500791d1f7a304ea2c1f52bbd3f07a15d5b319eafa9375f0'
AND (
token = 'fh1fVtvRA7bDb60LkizVvuxs7PKeM8KNJMWKu76nb0E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)