UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qkyKkQVGKO90UWKcAZIoWcL9KEMBwQRdKMYXo7ViQHs='
WHERE
key_id = 'e355383f6d154b21344b5c5173d332387895d50a7d6e2f83d0a63c208e97cf16'
AND (
token = 'qkyKkQVGKO90UWKcAZIoWcL9KEMBwQRdKMYXo7ViQHs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)