UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2S2gwgZcqSWFukQYQzqpCjn7k81ClMVAQKmvEBPD3JU='
WHERE
key_id = 'be728eb5cf94023ec818ff9b9f1b1182aafb3fff8a747deea9eefe4c539460c7'
AND (
token = '2S2gwgZcqSWFukQYQzqpCjn7k81ClMVAQKmvEBPD3JU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)