UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5yMGqBMMPeTDUCnqw0zUjNq6DJOyMjchlw0a+aPXbgM='
WHERE
key_id = 'c3aefdfa7fe6a97aef72a1ce297a416ea74cfe4ccd5255ebfd2fbbfcba41ee33'
AND (
token = '5yMGqBMMPeTDUCnqw0zUjNq6DJOyMjchlw0a+aPXbgM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)