UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'NnjGZRJFdBRxOmZIfxOZg5Atvil6G9DzyIq1lNtYqyE='
WHERE
key_id = '9fddce23f3f9cd00d852708dd24cd6c3432a63785947a09ea4d8c8151bda3109'
AND (
token = 'NnjGZRJFdBRxOmZIfxOZg5Atvil6G9DzyIq1lNtYqyE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)