UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1hUTBxtPYxPcgLrnyT6f2yIogsdUejjlbQgzbXLQCq8='
WHERE
key_id = '27299186459766ad8c8ff40fdc1329193f90b291a4600eda3623243abbd0bf6c'
AND (
token = '1hUTBxtPYxPcgLrnyT6f2yIogsdUejjlbQgzbXLQCq8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)