UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'pm9WN4mttjRyGOLpZhQileDUDtQWRTIrUfSdiknzEKc='
WHERE
key_id = '2190c8d38fa7406074c084155bd25e9b724cd8257e6dccdeace25eab2a9e20c4'
AND (
token = 'pm9WN4mttjRyGOLpZhQileDUDtQWRTIrUfSdiknzEKc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)