UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5FY9K69PM153o8a0ltP9ksLb1clQj6RdU9U2F/3c4jk='
WHERE
key_id = 'd7c97441949a1f244db1ba7dce9b7b45b85ff9d4cd4b70c91fa31f4e7fd3d78c'
AND (
token = '5FY9K69PM153o8a0ltP9ksLb1clQj6RdU9U2F/3c4jk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)