UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ih5hxysaOBUNyEjaIFsCI4PgjazYxcHGDs3FNeZU8gY='
WHERE
key_id = '063b660afec55d69d7a955fd0a767ad4b8ab2a1f3721738e379ba945e6a4de92'
AND (
token = 'ih5hxysaOBUNyEjaIFsCI4PgjazYxcHGDs3FNeZU8gY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)