UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'narVP6B1U+D7GTSq/hEoUb4A7FDojdNAsHq1a7NQd1s='
WHERE
key_id = '25383c8c6d8a5f9a80b6254e88e8e3ea4dcb0d08b5d684aaf7b84874982f84bb'
AND (
token = 'narVP6B1U+D7GTSq/hEoUb4A7FDojdNAsHq1a7NQd1s='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)