UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'IyQte15gfsp7nVcj8YeEh0YzDIhA/zTLT00dKU+klBw='
WHERE
key_id = '08e917a6ef362e086789067975fd6a6a31dcaa2c7da483a84ea7ca2ca41b311f'
AND (
token = 'IyQte15gfsp7nVcj8YeEh0YzDIhA/zTLT00dKU+klBw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)