UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '56tXGOGJpXsitGFhI4Ebum0xksMNiOdERc3FnUj/5xM=' 
WHERE 
  key_id = '64c9ac9fe9ae0dcff651a032b0b880f0bbfa1296bc4a4deddb073927d0ee932e' 
  AND (
    token = '56tXGOGJpXsitGFhI4Ebum0xksMNiOdERc3FnUj/5xM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031