UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qKGQObubCJJKM2E2Jxwov7N/13Xw0cShNzpOipMX6xE='
WHERE
key_id = '347be3c5c34a73c6dffa4c071a158265e718e52804556ed85c7c05eef72655ce'
AND (
token = 'qKGQObubCJJKM2E2Jxwov7N/13Xw0cShNzpOipMX6xE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)