UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'dBG0bsuv+ovJKmFtpMlw+IMAGgO8u/ZmbvQHz6528DU='
WHERE
key_id = '6f2e283631832faf67c4ae36cf5e2074420234addf2d7b5f0880a9f59f5ac1b4'
AND (
token = 'dBG0bsuv+ovJKmFtpMlw+IMAGgO8u/ZmbvQHz6528DU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)