UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'VMSmXeVcLZrRktvBrjSwMpmqX3bLPq9qszQYDjjyoiM='
WHERE
key_id = '7dd0ec70ab643b511db004062e0f9fc4898eb2bc9bd584c4cf43bf3515d78359'
AND (
token = 'VMSmXeVcLZrRktvBrjSwMpmqX3bLPq9qszQYDjjyoiM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)