UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'STGTmnwe2d5MJn4bK1OI+7Q3R6R5yXXW/KZsXq7L3Zg=' 
WHERE 
  key_id = 'aefc8cee3b74172c85d9661d401d2aebc856d6e49f7edea6206921d478b48508' 
  AND (
    token = 'STGTmnwe2d5MJn4bK1OI+7Q3R6R5yXXW/KZsXq7L3Zg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028