UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'j3PL8vVJ1kNWY7odHOI+1a/xtPDLYTylWIPwVqLGSyw=' 
WHERE 
  key_id = '7366a4424d361492c3535b5d478a4cb508527538e38de803bba3ba5afa6abf0d' 
  AND (
    token = 'j3PL8vVJ1kNWY7odHOI+1a/xtPDLYTylWIPwVqLGSyw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031