UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'rdXcwh/D7zdqnclXi4kcN3uhHKP0yuJ/PBNl5xNUn5E=' 
WHERE 
  key_id = '0865372ffe9c22aa2c067bd248dd9c0f2cb643c3a033231621186bce930dbdd3' 
  AND (
    token = 'rdXcwh/D7zdqnclXi4kcN3uhHKP0yuJ/PBNl5xNUn5E=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030