UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'bQlN7faXEUd54GF41sFEiUTKd/zI9suqu65kUefKCOw='
WHERE
key_id = 'de3b404796e6406d46bbf02cf2516dc8df2ce07fab9979d77a81c03298d8d4a9'
AND (
token = 'bQlN7faXEUd54GF41sFEiUTKd/zI9suqu65kUefKCOw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)